
package com.lee.fpflink; 
 
import com.alibaba.fastjson.JSONArray; 
import com.google.common.collect.Lists; 
import com.lee.enumeration.FPFlinkQualifierEnum; 
import com.lee.enumeration.FinishQualifierEnum; 
import com.lee.info.CkFlowInfo; 
import com.lee.logger.Logger; 
import com.lee.utils.*; 
import org.apache.flink.api.common.functions.FlatMapFunction; 
import org.apache.flink.util.Collector; 
 
import java.io.IOException; 
import java.util.List; 
 
public class CountIndexFunction implements FlatMapFunction<List<String>, CkFlowInfo> { 
 
 
    @Override
     public void flatMap(List<String> bdsCkFlowList, Collector<CkFlowInfo> collector)  {
 
        try {
 
            DMapUtils.addIndex();
            long index = DMapUtils.getIndex();
            CkFlowInfo ckFlowInfo =  new CkFlowInfo();
            ckFlowInfo.setDIndex(index);
            ckFlowInfo.setCkList(bdsCkFlowList);
            Logger.info("countindexfunction index " + index + " ,ckflowinfo " + ckFlowInfo);
            collector.collect(ckFlowInfo);
        } catch (IOException e) {
            e.printStackTrace();
        }
 
 
 
    }
 
 
 
} 
